<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>RaspBerryPi power control: SwSPI.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">RaspBerryPi power control
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">SwSPI.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="SwSPI_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * SwSPI.hpp</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> *  Created on: 10.1.2013</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *      Author: lukas</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#ifndef SWSPI_HPP_</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define SWSPI_HPP_</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="keywordtype">void</span>  <a class="code" href="SwSPI_8cpp.html#aa148f1326a12cdddd248b84fa77f8b26">ToBin</a> ( <span class="keywordtype">int</span> number, <span class="keywordtype">int</span>* numberBin );</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="keywordtype">int</span>  <a class="code" href="SwSPI_8cpp.html#a917c52014b8998155b6e7dd4971ed575">BinTo</a> (<span class="keywordtype">int</span>* numberBin);</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="keywordtype">int</span> <a class="code" href="SwSPI_8cpp.html#a68a317f4d1034335cc62cd9057b5f797">SwSpiInit</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="keywordtype">void</span> <a class="code" href="SwSPI_8cpp.html#af1e6347b800ee27fd9221ea688cd5324">SwSpiRW</a>(<span class="keywordtype">int</span> ChSelect, <span class="keywordtype">int</span>* buffer, <span class="keywordtype">int</span> PocetSlov);</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div>
<div class="line"><a name="l00016"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#afd196d9b1d680711b2be6a32aab3bb9f">   16</a></span>&#160;<span class="preprocessor">#define SPICLK 1</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#acf49a2197a0c0541e4e1dba163a6624a">   17</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CS_SPI0 1</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#a40b3089025ef1265116851dfcae55c8e">   18</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CS_SPI1 1</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#a5d3f11f2fdf8a7e27b975291e0c2c8cc">   19</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define MOSI 1</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#a7334c540878c8c4d801fd75ed9fd8063">   20</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define MISO 1</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00022"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#a5de279e378a1ea5a94ed91239a5ebfa3">   22</a></span>&#160;<span class="preprocessor">#define NUM_PINS        17</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#a7f388096406b9fed5f17926c6793fcf6">   24</a></span>&#160;<span class="preprocessor">#define WPI_MODE_PINS            0</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#afeefd0543f428fc754ddd26ba2257c72">   25</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define WPI_MODE_GPIO            1</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#a3e8ab8a17ead0820f7fc588fa20a0c94">   26</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define WPI_MODE_GPIO_SYS        2</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#a8c912cd22c53b4274898965ecd7aaee5">   27</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define WPI_MODE_PIFACE          3</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00029"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#a1bb283bd7893b9855e2f23013891fc82">   29</a></span>&#160;<span class="preprocessor">#define INPUT            0</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#a61a3c9a18380aafb6e430e79bf596557">   30</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define OUTPUT           1</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#af061d92c703ae47631ce7e2f26e37c61">   31</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define PWM_OUTPUT       2</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#ab811d8c6ff3a505312d3276590444289">   33</a></span>&#160;<span class="preprocessor">#define LOW              0</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#a5bb885982ff66a2e0a0a45a8ee9c35e2">   34</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HIGH             1</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#a7325e80d331159877dcd8baf2020b677">   36</a></span>&#160;<span class="preprocessor">#define PUD_OFF          0</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#a9a2298052cddfeeab28a43de90de9bef">   37</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define PUD_DOWN         1</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#abca66a4d6b79044f4a8e9e98845be8c7">   38</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define PUD_UP           2</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#a3ae3a0989a1b1152a867c89e32766d61">   40</a></span>&#160;<span class="preprocessor">#define SPIT2 36</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#ace1c04c661d0eb88ed3e2a4202b397ad">   41</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define SPIT1 SPIT2</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#a79944a5bd190fc96de164de714086c6c">   42</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define SPIT3 SPIT2</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="code" href="SwSPI_8hpp.html#a175f6058c9a87ebd216477f1e7a8588c">   43</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define SPIT7 2*SPIT2</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* SWSPI_HPP_ */</span><span class="preprocessor"></span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Apr 16 2013 12:54:48 for RaspBerryPi power control by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.3.1
</small></address>
</body>
</html>
